﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Windows.Media.Animation;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Media3D;
using System.Windows.Markup;
using System.Windows.Media;
using System.Globalization;
using CrazyWorship1.PropertyHandler;

namespace CrazyWorship1.Creators
{
    public class CreateAllInLine:CreateAllBase
    {



        public override void SetupPanes()
        {

            
            
            int i = 0;
            foreach (DataRowView a in CurrentState.CurrentLyrics)
            {
                Point3D point = new Point3D(_xOffset*i, _yOffset*i, _zOffset*i);
                SongDB.LyricsRow b = (SongDB.LyricsRow)a.Row;
                CreateTextPanel(TextModelGroup, b.LyricID, b.Text, b.Style, point, Rotation3D.Identity, new Point3D(0, 0, 0), new Vector3D(1, 1, 1));
                SetIn(b.LyricID, b.InStoryBoard);
                SetOut(b.LyricID, b.OutStoryBoard);
                i++;
            }
            SetSongIn(CurrentState.CurrentSong.InStoryBoard);
            SetSongOut(CurrentState.CurrentSong.OutStoryBoard);
        }
       
        private double _zOffset;
        [DataAttribute("ZOffset", typeof(DoublePropertyHandler),"CreatAllInLineDefaultZOffset")]
        public string ZOffset
        {
            get
            {
                return _zOffset.ToString(CultureInfo.InvariantCulture);
            }
            set
            {
                _zOffset = Convert.ToDouble(value, CultureInfo.InvariantCulture);
            }
        }
        private double _yOffset;
        [DataAttribute("YOffset", typeof(DoublePropertyHandler), "CreatAllInLineDefaultYOffset")]
        public string YOffset
        {
            get
            {
                return _yOffset.ToString(CultureInfo.InvariantCulture);
            }
            set
            {
                _yOffset = Convert.ToDouble(value, CultureInfo.InvariantCulture);
            }
        } private double _xOffset;
        [DataAttribute("XOffset", typeof(DoublePropertyHandler), "CreatAllInLineDefaultXOffset")]
        public string XOffset
        {
            get
            {
                return _xOffset.ToString(CultureInfo.InvariantCulture);
            }
            set
            {
                _xOffset = Convert.ToDouble(value, CultureInfo.InvariantCulture);
            }
        }


      

       
    }
}
